2D Plotting with Java
Version 2.0 of the classes and applets described below should
be available here in the first few weeks of 1996. The improvements
will include asynchronous data loading, a general applet for plotting
that interprets a descriptive plotting language (similar to gnuplot).
This page contains pointers to freely available Java software I have written.
All the applets should work with
Netscape Version 2.0b1J as they were developed
using the Java Developers Kit Version 1.0 Pre-Beta 1.
Keeping in the above spirit of version numbering I think that the software here
should be considered Version 1.0 Alpha pre-Beta.
The main idea of the classes distributed here is to provide a class
interface to plot 2D data.
At the moment the classes are distributed seperately but as
the number grow they should be incorporated into a package.
The idea of yet another plotting package might offend the sensibilities
of some people. But the justification in this case is to allow people to
view data interactively. Currently the only way to display data on
a web client is through static images. With applets only the data need be sent
to the client (in most cases this is a considerably smaller data stream than
a static image). The user can then format and manipulate the data locally.
Currently the interface is basic and consists of only 3 classes and will only
plot 2D data.
Classes
- Graph2D Class Version 1.0.
- This is the main class that controls the Canvas to be drawn to.
It positions the axis and the data window, and its update/paint
methods do the complete redrawing of the canvas.
- G2Dint Class Version 1.0.
- This is an extension of the Graph2D class that incorporates event
handling. This allows the user to modify the data window using
mouse drag events.
- DataSet Class Version 1.0.
- This is the class that stores each data set, and the associated
style variables such as color, markers, etc.
- Axis Class Version 1.0.
- This is the class that stores information about each axis to be drawn.
- StringKludge Class Version 0.0.
- This is required as the float to string and double to string conversion
does not work in Netscape Version 2.0b1J. A stupid oversight. This class
is a quick hack and will fail but is OK as an interim fix.
Because this is a quick fix it should be noted that the axis labels
sometimes look odd, the labels are drawn using StringKludge.
Please send me mail if you find the classes described here useful, find bugs,
have
any suggestions for improvement or have extended them in any way. I am
continuing to work on improving and extending them, though as I will
be unemployed from November 1995, this work could be intermittent.
Examples
There are a number of example applets
showing what can be done using the graphing classes.
Last modified: Mon Oct 30 09:34:28 PST 1995